import { defHttp } from "@/utils/http";

// ERP 资产操作 VO
export interface PropertyOperaVO {
	id: number; // ID
	parentId: number; // 父级ID
	reasonNo: string; // 自定义编号
	name: string; // 名称
	sqNumb: number; // 顺序
	type: number; // 类型
	status: string; // 状态
}

// ERP 资产操作 API
export const PropertyOperaApi = {
	// 查询资产操作分页
	getPropertyOperaPage: async (params: any) => {
		return await defHttp.get({ url: `/whs/asm-opreasons/page`, params });
	},

	// 查询资产操作详情
	getPropertyOpera: async (id: number) => {
		return await defHttp.get({ url: `/whs/asm-opreasons/get?id=` + id });
	},

	// 新增资产操作
	createPropertyOpera: async (data: PropertyOperaVO) => {
		return await defHttp.post({ url: `/whs/asm-opreasons/create`, data });
	},

	// 修改资产操作
	updatePropertyOpera: async (data: PropertyOperaVO) => {
		return await defHttp.put({ url: `/whs/asm-opreasons/update`, data });
	},

	// 删除资产操作
	deletePropertyOpera: async (id: number) => {
		return await defHttp.delete({
			url: `/whs/asm-opreasons/delete?id=` + id
		});
	},

	// 导出资产操作 Excel
	exportPropertyOpera: async (params: any) => {
		return await defHttp.download({ url: `/whs/asm-opreasons/export-excel`, params });
	}
};
